/*
 * Created on Oct 22, 2003
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.vectrics.recruiter.job;

import java.sql.ResultSet;
import java.util.Date;

import org.apache.log4j.Logger;
import org.vectrics.common.db.JdbcTarget;
import org.vectrics.common.db.ProcessException;

public class FindJobDateJdbc implements JdbcTarget {
	private transient static Logger log = Logger.getLogger(FindJobDateJdbc.class);
	//private static SimpleDateFormat sqlDateFormat = new SimpleDateFormat("yyyy-MM-dd");
	
	private String sqlQry = "";
//	HashSet searchWordList = null;
	//private String searchWords = null;
	private Date datePosted = null;
		

	public FindJobDateJdbc(Long jobId) {                	
		sqlQry = "select date_posted from job_post where id = " + jobId + "";
	}
	
	public Date getDate() {
		return(datePosted);
	}

	
	public void processResults(ResultSet resultSet) throws ProcessException {
		try {
			log.debug("findMatchingJobs() - processing query results.");
			if (resultSet.next()) {
				datePosted = resultSet.getDate("date_posted");
			}
		}
		catch (java.sql.SQLException se) {
			log.error("findMatchingJobs() - exception walking results.", se);
		}
	}

	
	public String getQuery() {
		return(sqlQry);		
	}
}

